home *** CD-ROM | disk | FTP | other *** search
- /* This program mcimail.c created by Delrina and assigned to the mcimail session*/
- /* runs an automated logon script for connecting to MCI Mail. */
-
- /* $Revision: 1.2 $ */
- /* $Date: 27 Oct 1995 14:42:46 $ */
- #include "defines.h"
-
-
- /* Define main function, which is always the starting point of C programs. */
- /* (The term "void" indicates that the function returns no value.) */
- void main()
- {
- /* Declare variables */
- long ScriptHandle;
- int ReturnValue;
- char Buffer[128];
-
- /* Initialize variables */
- ReturnValue = 0;
- ScriptHandle = 0;
-
- /* Establish a link between this script program and Delrina WinComm PRO */
- ScriptHandle = dcInitialize(0,0,0,0);
-
- /* Exit if intialization of link with Delrina WinComm PRO failed */
- if (ScriptHandle == 0) exit();
-
- ReturnValue = -1;
- /* Wait for the user name prompt */
- while (ReturnValue < 0)
- {
- ReturnValue = dcWaitForString(ScriptHandle, 1, " name: ", 3000L);
- if (ReturnValue == DC_ERR_CONECTION_LOST)
- break;
- if (ReturnValue < 0)
- dcTypeText(ScriptHandle, 0, "\r");
- }
-
- /* Get User Name value from Runtime values dialog box */
- if (ReturnValue >= 0)
- ReturnValue = dcGetRuntimeValue(ScriptHandle, 1, 1, 128, Buffer);
-
- /* Type the value */
- if (ReturnValue >= 0)
- ReturnValue = dcTypeText(ScriptHandle, 0, Buffer);
-
- /* Wait for a prompt */
- if (ReturnValue >= 0)
- ReturnValue = dcWaitForString(ScriptHandle, 1, "sword: ", 32000L);
-
- /* Get Password value from Runtime Values dialog box */
- if (ReturnValue >= 0)
- ReturnValue = dcGetRuntimeValue(ScriptHandle, 3, 1, 128, Buffer);
-
- /* Type the value */
- if (ReturnValue >= 0)
- ReturnValue = dcTypeText(ScriptHandle, 0, Buffer);
-
- /* Terminate link between Delrina WinComm PRO and script program */
- dcTerminate(ScriptHandle, 0);
- }
-
-
-